
package soot;

import java.util.Map;

import soot.Body;
import soot.BodyTransformer;


public class BodyValidator extends BodyTransformer {

	public static final BodyValidator singleton = new BodyValidator();

	/* (non-Javadoc)
	 * @see soot.BodyTransformer#internalTransform(soot.Body, java.lang.String, java.util.Map)
	 */
	@Override
	@SuppressWarnings("rawtypes")
	protected void internalTransform(Body body, String phaseName, Map options) {

		System.out.print("Validating");

		System.out.print(" locals");
		body.validateLocals();

		System.out.print(" traps");
		body.validateTraps();

		System.out.print(" unitBoxes");
		body.validateUnitBoxes();

		System.out.print(" valueBoxes");
		body.validateValueBoxes();

		System.out.print(" uses");
		body.validateUses();

		System.out.print(" everything");
		body.validate();

		System.out.println(" done");
	}
}
